package com.neo.pub.service.impl;

import com.neo.common.annotation.DataSource;
import com.neo.common.core.text.Convert;
import com.neo.common.enums.DataSourceType;
import com.neo.pub.domain.Patient;
import com.neo.pub.domain.SMSUser;
import com.neo.pub.mapper.PatientMapper;
import com.neo.pub.mapper.SMSMapper;
import com.neo.pub.service.IPatientService;
import com.neo.pub.service.ISMSUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 用户 业务层处理
 * 
 * @author tr
 */
@Service
public class SMSUserServiceImpl implements ISMSUserService
{
    private static final Logger log = LoggerFactory.getLogger(SMSUserServiceImpl.class);

    @Autowired
    private SMSMapper smsMapper;

    @Override
    public List<SMSUser> selectSMSUserList(SMSUser smsUser) {
        return smsMapper.selectUserList(smsUser);
    }

    @Override
    public SMSUser selectSMSUserById(int id) {
        return smsMapper.selectUserById(id);
    }

    @Override
    @Transactional
    public int updateUser(SMSUser smsUser) {
        return smsMapper.updateUser(smsUser);
    }

    @Override
    public int deleteUserByIds(String ids) throws Exception {
        String[] userIds = Convert.toStrArray(ids);
        return smsMapper.deleteUserByIds(userIds);
    }

    @Override
    public int insertUser(SMSUser smsUser) {
        return smsMapper.insertUser(smsUser);
    }

    @Override
    public int changeStatus(SMSUser smsUser) {
        return smsMapper.updateUser(smsUser);
    }

}
